import React from 'react'
import {View} from "@tarojs/components";
import './index.scss'


function Field({error = '', children, clsName = ''}) {
  return <View className={`field-wrapper ${error ? 'error' : ''} ${clsName}`}>
    {children}
    {error && <View className='error-message'>{error}</View>}
  </View>
}

export default Field
